<template>
  <div>
    <div class="notAuthShare_checkbox_card" v-if="dataList && dataList.length">
      <van-row type="flex" justify="space-between">
        <van-col span="12" style="padding-left: 20px">
          <van-button
            style="margin-right: 15px;"
            size="small"
            v-show="blackType != 1 && type != 1"
            :type="btnStatus ? 'warning' : 'info'"
            @click="checkAllOrNot"
          >{{ btnStatus ? '重置' : '全选' }}
          </van-button>
        </van-col>
        <van-col span="12" style="text-align: right; padding-right: 20px" v-show="keyWord === 'shareOrNot'">
          <van-button
            size="small"
            :type="actionType === 'delete' ? 'danger' : 'warning'"
            @click="deleteNotAuthShareList"
            :disabled="currentSelectedArr.length === 0"
          >{{ actionType === 'delete' ? '删除' : '增加' }}</van-button
          >
        </van-col>
      </van-row>
      <van-checkbox-group
        ref="checkboxGroup"
        v-model="currentSelectedArr"
        class="multiple_checkbox_card"
        @change="pitchOn($event)"
      >
        <van-cell v-for="(item, index) in dataList" :key="item.id" @click="toggleEach(index)" class="checkbox_item">
          <!--  左侧title的插槽      -->
          <template #title>
            <!--   todo 当时写的demo组件，目前暂时不做该需求       -->
            <van-row v-show="keyWord === 'shareOrNot'" class="notAuthShare_item" type="flex" align="center">
              <van-col span="5">
                <div>
                  <van-image round cover width="1rem" height="1rem" :src="item.logo" />
                  <div style="margin-top: 10px; font-weight: bold">{{ '麦穗' }}</div>
                </div>
              </van-col>
              <van-col span="17">
                <div style="text-align: left" class="share_item">
                  <span>公司名称：</span>
                  <span>{{ item.name }}</span>
                </div>
                <div style="margin-top: 10px; text-align: left" class="share_item">
                  <span>营业执照：</span>
                  <span>{{ '914403001922038216' }}</span>
                </div>
              </van-col>
            </van-row>

            <!--   用于【招聘员工】管理         -->
            <van-row
              v-show="keyWord === 'staffList'"
              type="flex"
              justify="space-between"
              class="part_recruitmentManagement"
            >
              <van-col span="21">
                <div style="display:flex;margin-bottom:10px;">
                  <div style="padding-top:10px;">
                    <van-image :src="item.avatar ? item.avatar: logoImg" round cover width="1.5rem" height="1.5rem" />
                  </div>
                  <div style="margin-top: 6px;padding-left:10px;">
                    <div style="margin-bottom:10px;text-align:left">近聘昵称：{{ item.nick_name }}</div>
                    <div style="text-align:left">近聘账号：{{ item.ids }}</div>
                    <div style="text-align:left; margin-top: 6px;padding-left:0;">
                    <span v-if="advaceInfoType === '5' || advaceInfoType === '3'">
                      手机号码：{{ item.mobile }}
                      <van-tag plain style="margin-left: 10px; padding:4px;" type="primary" @click.stop="phoneContact(item.mobile)">电话联系</van-tag>
                    </span>
                      <span v-else>
                      手机号码：{{ advaceInfoType === '1' ? item.mobile : item.line_mobile }}
                      <van-tag
                        plain style="margin-left: 10px; padding:4px;" type="primary"
                        @click.stop="phoneContact(advaceInfoType === '1' ? item.account : item.line_mobile)">电话联系</van-tag>
                    </span>
                    </div>
                  </div>
                </div>
                <div style="text-align: left">
                  <span>姓名：</span>
                  <span v-if="advaceInfoType == 1 || advaceInfoType == 5 || advaceInfoType == 3">{{
                      item.real_name ? item.real_name : ''
                    }}</span>
                  <span v-else>{{ item.name ? item.name : '' }}</span>
                </div>

                <div style="margin-top: 10px; text-align: left">
                  <span>性别：</span>
                  <span>{{ item.gender == 1 ? '男' : '女' }}</span>
                </div>
                <div style="margin-top: 10px; text-align: left">
                  <span>身份证号：</span>
                  <span>{{ item.card_id ? item.card_id : '暂无' }}</span>
                </div>
                <div v-show="blackType == 1" style="margin-top: 10px; text-align: left">
                  <span>黑名单状态：</span>
                  <span>白名单</span>
                  <span>
                  <van-tag plain style="padding:4px;margin-left:10px" @click="addblack()" type="primary"
                  >加入黑名单</van-tag
                  >
                </span>
                </div>
                <div v-show="addBtnBlackType == 1" style="border:1px solid #ccc;margin-top:5px;">
                  <van-field
                    autocomplete="off"
                    rows="2"
                    maxlength="50"
                    autosize
                    type="textarea"
                    show-word-limit
                    placeholder="请输入备注信息"
                  />
                </div>
                <div v-show="addBtnBlackType == 1" style="margin-top: 10px; text-align: right">
                <span>
                  <van-tag plain style="padding:4px;margin-left:10px" type="primary">提交</van-tag>
                </span>
                </div>

                <div v-show="blackType != 1" style="margin-top: 10px; text-align: left">
                  <span>报名时间：</span>
                  <span>{{ item.create_time ? item.create_time : '' }}</span>
                </div>
                <div v-show="advaceInfotype == 2" style="margin-top: 10px; text-align: left">
                  <span>报名状态：</span>
                  <span>{{ item.appstate == 1 ? '已读' : '未读' }}</span>
                </div>
                <div v-show="advaceInfotype == 2" style="margin-top: 10px; text-align: left">
                  <span>报到时间：</span>
                  <span>{{ item.baodaodate == null ? '' : item.baodaodate }}</span>
                </div>
                <div v-show="blackType != 1 && advaceInfotype != 2" style="margin-top: 10px; text-align: left">
                  <span>报到时间：</span>
                  <span>{{ item.baodaodate == null ? '' : item.baodaodate }}</span>
                </div>
                <div v-show="blackType != 1" style="margin-top: 10px; text-align: left">
                  <span>渠道来源：</span>
                  <span>{{ item.qudao == null || !item.qudao ? '' : item.qudao }}</span>
                </div>
                <div v-show="advaceInfotype == 1 ||  advaceInfotype == 3" style="margin-top: 10px; text-align: left; display: flex;">
                  <span>渠道备注：</span>
                  <span style="flex: 1">{{ item.channel_remark || '' }}</span>
                </div>
                <div v-show="advaceInfotype == 1 || advaceInfotype == 3" style="margin-top: 10px; text-align: left">
                  <span>工作状态：{{ jobState(item.job_status) }}</span>
                </div>
                <div v-show="advaceInfotype == 1 ||  advaceInfotype == 3 " style="margin-top: 10px; text-align: left; display: flex">
                  <span>工作状态备注：</span>
                  <span style="flex: 1">{{ item.job_status_remark || '' }}</span>
                </div>
                <div v-show="advaceInfotype == 1" style="margin-top: 10px; text-align: left">
                  <span>申请借支金额：{{ item.bill_money || 0 }}</span>
                  <span>
                  <van-tag plain style="margin-left: 10px;padding:4px;" type="primary" @click.stop="lookprice(item)"
                  >查看</van-tag
                  >
                  <van-tag
                    plain
                    style="margin-left: 10px;padding:4px;"
                    type="primary"
                    @click.stop="lookjl(item.job_id, item.user_id)"
                  >记录</van-tag
                  >
                </span>
                </div>

                <!--<div v-show='advaceInfotype==2' style="margin-top: 10px; text-align: left">
                    <span><van-tag
                      :type="isRead === 'read' ? 'success' : 'warning'"
                    >{{isRead === 'read' ? '报名已读' : '报名未读'}}</van-tag>
                    </span>
                </div>-->

                <div v-show="advaceInfotype == 2" style="margin-top: 10px; text-align: left">
                  <span>接送时间：</span>
                  <span>{{ item.jiesongdate == null ? '' : item.jiesongdate }}</span>
                </div>
                <div v-show="advaceInfotype == 2" style="margin-top: 10px; text-align: left">
                  <span>到用企时间：</span>
                  <span>{{ item.daoqidate == null ? '' : item.daoqidate }}</span>
                </div>
                <div v-show="advaceInfotype == 2" style="margin-top: 10px; text-align: left">
                  <span>分宿舍时间：</span>
                  <span>{{ item.fxsdate == null ? '' : item.fxsdate }}</span>
                </div>
                <div v-show="advaceInfotype == 2" style="margin-top: 10px; text-align: left">
                  <span>培训时间：</span>
                  <span>{{ item.peixundate == null ? '' : item.peixundate }}</span>
                </div>
                <div v-show="advaceInfotype == 2" style="margin-top: 10px; text-align: left">
                  <span>签合同时间：</span>
                  <span>{{ item.hetongdate == null ? '' : item.hetongdate }}</span>
                </div>

                <van-row v-show="advaceInfotype == 2"
                         class="content_photo"
                         type="flex" style="margin-top: 10px; text-align: left"
                         @click.stop
                >
                  <van-col span="6">
                    <span>身份证照片：</span>
                  </van-col>
                  <van-col span="18" class="content_pic">
                    <van-uploader
                      v-show="item.imgurl"
                      v-model="item.imgurl && (item.imgurl).split('|').map(urlPath => ({url: urlPath}))"
                      :deletable="false"
                      :show-upload="false"
                      :preview-options="{
                        closeable: true,
                      }"
                    />
                    <span v-show="!item.imgurl">无</span>
                  </van-col>
                </van-row>

                <div
                  v-show="blackType != 1 && advaceInfotype != 2 && advaceInfotype != 5"
                  style="margin-top: 10px; text-align: left"
                >
                  <span>开始工作时间：</span>
                  <span>{{ item.startdate == null ? '' : item.startdate }}</span>
                </div>
                <div
                  v-show="blackType != 1 && advaceInfotype != 2 && advaceInfotype != 5"
                  style="margin-top: 10px; text-align: left"
                >
                  <span>结束工作时间：</span>
                  <span>{{ item.overdate == null ? '' : item.overdate }}</span>
                </div>
                <div v-show="advaceInfotype == 5" style="margin-top: 10px; text-align: left">
                  <span>开始工作时间：</span>
                  <span>{{ item.startdate == null ? '' : item.startdate }}</span>
                </div>
                <div v-show="advaceInfotype == 5" style="margin-top: 10px; text-align: left">
                  <span>结束工作时间：</span>
                  <span>{{ item.overdate == null ? '' : item.overdate }}</span>
                </div>
                <div v-show="advaceInfotype == 3" style="margin-top: 10px; text-align: left">
                  <span>发薪时间：</span>
                  <span>{{ item.salaryuptime | formatDate }}</span>
                </div>
                <div v-show="advaceInfotype == 3" style="margin-top: 10px; text-align: left">
                <span>
                  <van-tag plain style="padding:2px" type="primary" @click.stop="paySalary(item.jobuserid)"
                  >输入工资</van-tag>
                </span>
                </div>
                <div v-show="advaceInfotype == 3" style="margin-top: 10px; text-align: left">
                  <span>{{ item.categoryname }} </span>
                </div>
                <div v-show="advaceInfotype == 3" style="margin-top: 10px; text-align: left">
                  <span>实发金额：{{ item.salarymoney || 0 }}</span>
                  <span>
                  <van-tag
                    plain
                    style="padding:2px;margin-left:10px"
                    type="primary"
                    @click.stop="getSalaryList(item.jobuserid)"
                  >工资记录</van-tag
                  >
                </span>
                </div>
                <div v-show="advaceInfotype == 3" style="margin-top: 10px; text-align: left">
                  <span style="margin-right:5px">代招类型:</span>
                  <span style="margin-right:5px"
                  >{{ item.generation_of_commission | formatMoney }} 元/{{ item.fee_unit | formatFeeUnit }}</span
                  >
                </div>
                <div v-show="advaceInfotype == 3" style="margin-top: 10px; text-align: left">
                  <span style="margin-right:5px">工作时长:</span>
                  <input
                    type="number"
                    @click.stop
                    v-model.number="item.quantityInput"
                    style="width:50px"
                    placeholder="请输入"
                    @input="feeTimeInputChange($event, index, item.generation_of_commission)"
                  />
                  {{ item.fee_unit | formatFeeUnit }}
                  <van-tag
                    plain
                    style="margin-left: 8px;padding:4px;"
                    type="primary"
                    @click.stop="submitTotal(item.jobuserid, item.quantityInput)"
                  >提交</van-tag>
                </div>
                <div v-show="advaceInfotype == 3" style="margin-top: 10px; text-align: left">
                <span style="margin-right:5px"
                >代招费：{{
                    item.totalFee
                      ? item.totalFee
                      : item.quantity
                        ? (item.quantity * item.generation_of_commission).toFixed(2)
                        : 0
                  }}元</span
                >
                  <span>
                  <van-tag
                    plain
                    style="padding:2px;margin-right:10px"
                    type="primary"
                    @click.stop="getFeePayList(item.jobuserid)"
                  >代招费记录</van-tag
                  >
                </span>
                </div>

                <div v-show="advaceInfotype == 5 && blackType != 1" style="margin-top: 10px; text-align: left">
                  <span>渠道备注：</span>
                  <br />
                  <textarea style="width:200px;height:20px;margin-top:10px;" v-model="item.channel_remark"></textarea>
                  <van-tag
                    plain
                    style="margin-left: 8px;padding:3px;"
                    type="primary"
                    @click.stop="getEidtJobInformation(0, item.user_id, item.channel_remark)"
                  >提交</van-tag>
                </div>
                <div v-show="advaceInfotype == 3" style="margin-top: 10px; text-align: left">
                  <span>支付代招费时间：</span>
                  <span>{{ item.feepaidtime | formatDate }}</span>
                </div>

                <div v-show="advaceInfotype == 1" style="margin-top: 10px; text-align: left">
                  <span>借支状态：{{ jiezhiState(item.bill_state) ? jiezhiState(item.bill_state) : '未借支' }}</span>
                </div>
                <div v-show="advaceInfotype == 5 && blackType != 1" style="margin-top: 10px; text-align: left">
                  <span>工作状态：{{ jobState(item.job_status) }}</span>
                  <span></span>
                </div>

                <div v-show="advaceInfotype == 5 && blackType != 1" style="margin-top: 10px; text-align: left">
                  <span>工作状态备注：</span>
                  <br />
                  <textarea style="width:200px;height:20px;margin-top:10px;" v-model="item.job_status_remark"></textarea>
                  <van-tag
                    plain
                    style="padding:3px;margin-left: 10px;"
                    type="primary"
                    @click.stop="getEidtJobInformation(1, item.user_id, item.job_status_remark)"
                  >提交</van-tag>
                </div>

                <div v-show="advaceInfotype == 5 && blackType != 1" style="margin-top: 10px; text-align: left">
                  <span>辞职申请状态：{{ resignStatus(item.resign_application_status) || '未提交' }}</span>

                  <van-tag
                    plain
                    style="padding:3px;margin-left:5px"
                    type="primary"
                    @click.stop="czTable(item.job_id, item.user_id)"
                  >
                    辞职申请表
                  </van-tag>
                </div>
                <div v-show="advaceInfotype == 5 && blackType != 1" style="margin-top: 10px; text-align: left">
                  <span>辞职申请时间：</span>
                  <span>{{ item.resign_application_time }}</span>
                </div>
                <div v-show="advaceInfotype == 5 && blackType != 1" style="margin-top: 10px; text-align: left">
                  <span>{{item.resign_application_status === 'NonApproval' ? '辞职不批准时间': '辞职批准时间'}}：</span>
                  <span>{{ item.resign_approval_time }}</span>
                </div>
              </van-col>
            </van-row>

            <!--   用于【上下游】管理         -->
            <van-row
              v-if="false"
              v-show="keyWord === 'upAndDownstreamCompany'"
              type="flex"
              justify="space-between"
              class="part_upAndDownstreamCompany"
            >
              <van-col span="6">
                <div>
                  <van-image round cover width="1.5rem" height="1.5rem" :src="item.logo" />
                  <div style="margin-top: 6px">{{ type == 0 || type == 2 ? '麦穗-下游' : '麦穗-上游' }}</div>
                </div>
              </van-col>
              <van-col span="18">
                <div style="text-align: left" class="concern_item">
                  <span>公司名称：</span>
                  <span>{{ item.name ? item.name : '' }}</span>
                </div>

                <div style="margin-top: 10px; text-align: left" class="concern_item">
                  <span>申请时间：</span>
                  <span>{{ item.create_time ? item.create_time : '' }}</span>
                </div>

                <div style="margin-top: 10px; text-align: left; display: flex; align-items:center;" class="concern_item">
                  <template v-if="item.audit === 1">
                    <span>{{ '已授权时间：' }}</span>
                    <span>{{ item.auditdate ? item.auditdate : '' }}</span>
                  </template>
                  <template v-else-if="item.audit === 2">
                    <span>{{ '不授权时间：' }}</span>
                    <span>{{ item.auditdate ? item.auditdate : '' }}</span>
                  </template>
                  <span v-else>未授权</span>
                </div>
              </van-col>
            </van-row>

            <com-my-attention
              v-show="keyWord === 'upAndDownstreamCompany'"
              :data-item="item"
              :no-folltime="true"
              :can-not-go-company="true"
            >
              <div style="margin-top: 10px; text-align: left" class="concern_item">
                <span>申请时间：</span>
                <span>{{ item.create_time ? item.create_time : '' }}</span>
              </div>
              <div style="margin-top: 10px; text-align: left; display: flex; align-items:center;" class="concern_item">
                <div v-if="item.audit === 1" style="font-weight: bold;">
                  <span>{{ '已授权时间：' }}</span>
                  <span>{{ item.auditdate ? item.auditdate : '' }}</span>
                </div>
                <div v-else-if="item.audit === 2" style="font-weight: bold; color: #FD0101; ">
                  <span>{{ '不授权时间：' }}</span>
                  <span>{{ item.auditdate ? item.auditdate : '' }}</span>
                </div>
                <span v-else style="font-weight: bold; color: blue; ">授权状态：暂未授权</span>
              </div>
            </com-my-attention>

            <!--  收到、支付的合作费，三级联动才显示的页面          -->
            <van-row
              v-show="keyWord === 'upDownCooperationFee'"
              type="flex"
              justify="space-between"
              class="part_upAndDownstreamCompany"
            >
              <van-col span="6">
                <div>
                  <van-image round cover width="1.2rem" height="1.2rem" :src="item.avatar" />
                </div>
              </van-col>
              <van-col span="18">
                <time-type-opt
                  :item="item"
                  :key="item.job_user_id"
                  :selectedSharedJobId="selectedSharedJobId"
                ></time-type-opt>
              </van-col>
            </van-row>

          </template>

          <!--  右侧icon的插槽      -->
          <template #right-icon v-if="type != 1">
            <van-checkbox
              v-show="blackType != 1"
              :name="setCheckName(item)"
              shape="square"
              ref="checkboxes"
              checked-color="#FA743B"
            />
          </template>
        </van-cell>
      </van-checkbox-group>
    </div>
    <van-empty v-else description="暂无数据" :style="{marginTop: '-10%'}" />
  </div>

</template>

<script>
import {Dialog, Toast} from 'vant'
import logoImg from '@/assets/logo.png'
import comMyAttention from "../../../../components/comMyAttention";
import {formatDate, formatMoney, formatFeeUnit} from '@/utils/format';

import TimeTypeOpt from "./timeTypeOpt";
import {imgStr} from "../../../../utils/mockData";



export default {
  name: 'comMultipleCheckboxCard',
  components: {
    TimeTypeOpt,
    comMyAttention
  },
  props: {
    dataList: Array,
    actionType: String,
    keyWord: String,
    isRead: String,
    advaceInfotype: String,
    type: String,
    enroll: String,
    blackType: Number,
    companyID: String,
    jobID: String,
    // 选中已转发后的职位id。
    selectedSharedJobId: String,
  },
  data() {
    return {
      logoImg,
      addBtnBlackType: 0,
      price: '2',
      // 当前选中列表
      currentSelectedArr: [],
      btnStatus: false,
      checked: true,
      channelInp: '',
      jobStatusInp: '',
      advaceInfoType: this.$route.query.advaceInfoType
    }
  },
  created() {},
  mounted() {},

  watch: {
    // 实现取消选择
    currentSelectedArr(val, oldVal){
      // console.log('监视', val)
      this.btnStatus = Boolean(val.length);
    },
  },
  methods: {
    /*
    * 多选指定的id
    * */
    setCheckName(item) {
      // console.log('指定当前选中某个id', item);
      /*
      * 招聘管理的页面: 使用了advaceInfoType作为标识：
      *  1、是借支; 2、报名页面;  3、工资; 5、工作
      * */

      /*switch (this.advaceInfoType){
        case '1':
          return item.user_id
        case '2':
          return item.id;
        case '3':
          return item.jobuserid
        case '5':
          return item.user_id
      };*/

      if (this.advaceInfoType == '5' || this.advaceInfoType == '1') {
        return item.user_id
      } else if (this.advaceInfoType == '2') {
        // 也就是每一项的id
        return item.id;
      } else if (this.advaceInfoType == '3'){
        // todo 待校验 应该没有问题
        return item.jobuserid
      }

      /*
      * 上下游的页面：使用了type作为标识
      * 0 收到的申请; 1是发出去的申请（不需要多选）
      * 2 是收到的合作费   3是支付的合作费
      * */
      if (this.type == 0 || this.type == 1) {
        // 使用 apply_user_id
        return item.apply_user_id
      } else if (this.type == 2){
        // todo 待校验 应该没有问题
        return item.job_user_id
      } else if(this.type == 3){
        return item.job_user_id
      }
    },
    lookjl(job_id, user_id) {
      // job_id="4f81f3ec9b8a40dbab8687437b8de68b"
      this.$router.push({
        path: `/lendMoneyDetail/${job_id}`,
        query: {
          user_id: user_id
        }
      })
    },
    async getEidtJobInformation(flag, id, Value) {
      let condition = ''
      if (flag === 1) {
        condition = 'JobStatusRemark'
      } else {
        condition = 'ChannelRemark'
      }
      const params = {
        condition,
        JobId: this.$route.query.jobInfoId,
        UserList: [id],
        Value: Value
      }
      await this.$api.job.getEidtJobInformation(params)
      this.$emit('update')
    },
    jobState(str) {
      let itemObj = {
        Leave: '自离',
        Resign: '辞职',
        OnJob: '在职',
        Approval: '辞职已批准',
        NonApproval: '辞职不批准'
      }
      return itemObj[str]
    },
    jiezhiState(str) {
      // BillState: 0.未处理;1.已借支;2.不借支;3.已失效;
      let itemObj = {
        '0': '申请中',
        '1': '已借支',
        '2': '不借支',
        '3': '已失效'
      }
      return itemObj[str]
    },

    resignStatus(str) {
      let itemObj = {
        Approval: '辞职批准',
        NonApproval: '辞职不批准',
        Applying: '辞职申请中'
      }
      return itemObj[str]
    },

    pitchOn(selectList) {
      console.log('触发父组件----事件');
      if (this.advaceInfotype == 1) {
        // 借支
        console.log('datalist', this.dataList)
        let lendMoneyList = []
        for (const item of this.dataList) {
          if (selectList.indexOf(item.user_id) > -1) {
            lendMoneyList.push(item)
          }
        }
        this.$emit('sendSelectedArr', lendMoneyList)
      } else {
        console.log('当前选中的项目this.currentSelectedArr数组', this.currentSelectedArr)

        this.$nextTick(()=>{
          // 状态更新是异步的
          this.$emit('sendSelectedArr', this.currentSelectedArr)
        })
      }
    },

    //加入黑名单
    addblack() {
      this.addBtnBlackType = 1
    },

    // 输入工资
    paySalary(jobuserid) {
      this.$router.push({
        path: `/myCompany/insertSalary`,
        query: {
          jobuserid: jobuserid,
          companyid: this.companyID,
          jobid: this.jobID
        }
      })
    },

    // 工资记录
    getSalaryList(jobuserid) {
      this.$router.push({
        path: `/salaryList`,
        query: {
          jobuserid: jobuserid,
          jobid: this.jobID
        }
      })
    },

    // 代招费记录
    getFeePayList(jobuserid) {
      this.$router.push({
        path: `/feePayList`,
        query: {
          jobuserid: jobuserid,
          jobid: this.jobID
        }
      })
    },

    // 提交工作时长
    submitTotal(jobUserId, quantity) {
      // TODO: by liuxiaoling 提交工作时长
      if (!quantity || quantity == 0) {
        Toast('请先填写工作时长!')
        return
      }
      let params = {
        JobId: this.jobID,
        JobUserId: jobUserId,
        Quantity: quantity
      }

      this.$emit('setWorkload', params)
    },

    //辞职申请表
    czTable(jobId, userId) {
      this.$router.push({
        path: '/myCompany/resignLog',
        query: {
          cz_type: 1,
          jobId,
          userId
        }
      })
    },
    //查看借支申请
    lookprice(item) {
      this.$router.push({
        path: '/applyLendMoney',
        query: {
          search_type: 1,
          id: item.job_id,
          job_user_id: item.user_id
        }
      })
    },

    deleteNotAuthShareList() {
      if (this.currentSelectedArr.length) {
        Dialog.confirm({
          title: '温馨提示',
          message: this.actionType === 'delete' ? '你确定删除吗？' : '你确定新增不可转发吗？'
        })
          .then(() => {
            // on confirm
            if (this.actionType === 'delete') {
              console.log('删除')
            } else if (this.actionType === 'add') {
              console.log('新增')
            }
          })
          .catch(() => {
            // on cancel
          })
      } else {
        Toast('未选择！')
      }
    },

    toggleEach(index) {
      if (this.type === '1' && this.$route.name === 'upAndDownstreamCompany'){
        // 当页面为：发出的申请的详细页面时候，不可操作点击。
        return null
      } else{
        // console.log('点击操作', index);
        this.$refs.checkboxes[index].toggle();
      }
    },
    checkAllOrNot() {
      if (!this.$refs.checkboxGroup){
        return null;
      };
      // 多选或重置
      this.$refs.checkboxGroup.toggleAll(!this.btnStatus)
      this.btnStatus = !this.btnStatus
    },

    operationShare() {
      console.log('是否转发')
      Dialog.confirm({
        // title: '温馨提示',
        message: '你确定更改吗？'
      })
        .then(() => {
          // on confirm
        })
        .catch(() => {
          // on cancel
        })
    },

    phoneContact(val) {
      console.log('电话联系');
      window.location.href = `tel:${val}`
    },

    feeTimeInputChange(e, index, generationOfCommission) {
      let f = parseFloat(e.target.value)
      if (isNaN(f)) {
        this.$set(this.dataList[index], 'quantityInput', '')
        this.$set(this.dataList[index], 'totalFee', 0)
      } else {
        this.$set(this.dataList[index], 'quantityInput', f)
        this.$set(this.dataList[index], 'totalFee', (f * generationOfCommission).toFixed(2))
      }
    }
  },

  filters: {
    formatDate(date) {
      return formatDate(date, '-', ':')
    },
    formatMoney(money) {
      return formatMoney(money)
    },
    formatFeeUnit(feeUnit) {
      return formatFeeUnit(feeUnit)
    }
  }
}
</script>

<style lang="scss" scoped>
.notAuthShare_checkbox_card {
  .multiple_checkbox_card {
    .checkbox_item {
      padding: 6px 10px 6px 0;
      border: 1px solid #eeeeee;
      .notAuthShare_item,
      .part_recruitmentManagement,
      .part_upAndDownstreamCompany {
        background-color: #ffffff;
        text-align: center;
        box-sizing: border-box;
        line-height: 1.1em;
        padding: 3px 0;
        font-size: 13px;
        .share_item {
          display: flex;
          span {
            &:first-of-type {
              width: 5em;
              font-size: 13px;
              /* 某一项不缩放  */
              flex-shrink: 0;
            }
            &:last-of-type {
              letter-spacing: 0.3px;
            }
          }
        }
      }

      /deep/ .part_recruitmentManagement{
        .van-col--3 {
          border: 1px solid red;
          display: none;
        }

        .van-col--21 {
          padding-left: 16px;
          width: 100%;
        }
      }
    }

    .content_photo{
      padding-bottom: 1px;
      .content_pic{
        border-bottom: 1px solid #F7F7F7;
      }
    }
  }
  .userInfoBtn {
    width: 50px;
    height: 30px;
    margin: 5px 0;
    margin-top: 5px;
    .userInfo_Btn {
      width: 100%;
      height: 30px;
      margin-top: 5px;
    }
  }
}
</style>
